package com.baidu.controller;

import com.baidu.pojo.TbCity;
import com.baidu.service.TbCityService;
import com.baidu.utils.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/city")
@CrossOrigin
public class CityController {
    @Autowired
    TbCityService tbCityService;

    @PostMapping("/sanji/{pid}")
    public ResultResponse findCityList(@PathVariable("pid") Integer pid){
        List<TbCity> tbCities=tbCityService.sanji(pid);
        return ResultResponse.SUCCESS(tbCities);
    }
}
